using System;
using System.Collections;
using System.Collections.Generic;
namespace DalatCooking.Core
{
    public class PersonManager
    {
        static PersonAccessor accessor = new PersonAccessor();
        public static bool Insert(Person entity)
        {
            return accessor.Insert(entity);
        }
        public static bool Update(Person entity)
        {
            return accessor.Update(entity);
        }
        public static bool Delete(int id)
        {
            return accessor.Delete(id);
        }
        public static bool Delete(Person entity)
        {
            return accessor.Delete(entity);
        }
        public static Person Login(string userName, string password)
        {
            return accessor.Login(userName, password);
        }
        public static Person LoginEmail(string email, string password)
        {
            return accessor.LoginEmail(email, password);
        }
        public static bool ChangePassword(Person entity)
        {
            return accessor.ChangePassword(entity);
        }

        public static bool ResetPassword(Person entity)
        {
            return accessor.ResetPassword(entity);
        }
        public static List<Person> FindAll()
        {
            return accessor.FindAll();
        }
        public static Person FindById(int id)
        {
            return accessor.FindById(id);
        }
        public static Person Single(int id)
        {
            return accessor.Single(id);
        }
        public static Person  FindByUserName(string username) {

            return accessor.FindByUserName(username);
        }
        public static Person FindByEmail(string email)
        {
            return accessor.FindByEmail(email);
        }
        public static List<Person> PagingSql(int pageSize, int pageNum, out int totalRowCount)
        {
            return accessor.PagingSql(pageSize, pageNum, out totalRowCount);
        }
        public static List<Person> PagingLinq(int pageSize, int pageNum, out int totalRowCount)
        {
            return accessor.PagingLinq(pageSize, pageNum, out totalRowCount);
        }
        public static bool SetActive(int id)
        {
            return accessor.SetActive(id);
        }
        public static bool SetSortIndex(int id, int isup)
        {
            return accessor.SetSortIndex(id, isup);
        }
        public static bool RemoveSelectedItem(int id)
        {
            return accessor.RemoveSelectedItem(id);
        }
        public static bool RemoveAll()
        {
            return accessor.RemoveAll();
        }
        public static bool RestoreSelectedItem(int id)
        {
            return accessor.RestoreSelectedItem(id);
        }
        public static bool RestoreAll()
        {
            return accessor.RestoreAll();
        }
        public static ArrayList FindAllPersonRoles(int personID)
        {
            return accessor.FindAllPersonRoles(personID);
        }
        public static List<Role> FindAllRoleById(int personID)
        {
            return accessor.FindAllRolesById(personID);
        }

        public static bool Person_AddRole(int personId, int roleId)
        {
            return accessor.Person_AddRole(personId, roleId);
        }
        public static bool Person_RemoveRole(int personId, int roleId)
        {
            return accessor.Person_RemoveRole(personId, roleId);
        }
        public static List<Person> FindAllMembers(int pageSize, int pageNum, out int totalRowCount)
        {
            return accessor.FindAllMembers(pageSize, pageNum, out totalRowCount);
        }
    }
}